import numpy as np
import matplotlib.pyplot as plt
# 生成空白图像
fig = plt.figure()
ax = fig.add_subplot(111,projection='3d')
# 定义要生成值的个数
n = 250
f = lambda minval,maxval,n:minval+(maxval-minval)*np.random.rand(n)
# 生成值
x_vals = f(15,41,n)
y_vals = f(-10,70,n)
z_vals = f(-52,-37,n)
# 画出值
ax.scatter(x_vals,y_vals,z_vals,c='k',marker='o')
ax.set_xlabel("X axis")
ax.set_ylabel("Y axis")
ax.set_zlabel("Z axis")
plt.show()